<!DOCTYPE html>
<html style="font-size: 23.4375px;">
<head>
    <include file="./public/header.html"/>
<body style="font-size: 21.7589px;">
<div id="app">
    <div id="shadow" style="display: none;"></div>
    <header class="top"><span style="display: none;">
        加载中...</span> <span>验证密保问题</span> <!---->
        <div class="iconfont back" style="display: none;"></div>
        <a href="./securityCenter.html" class="iconfont back"></a>
    </header>

    <div data-v-3d6918de="" class="main" s="[object Object]">
        <input type="hidden" name="id" id="uid" value="{$id}">
        <table data-v-3d6918de="">
            <tbody data-v-3d6918de="">
            <tr data-v-3d6918de="">
                <td data-v-3d6918de="">问题一</td>
                <td data-v-3d6918de="">
                    <select  id="anser1" data-v-3d6918de=""  class="va84 unique" >
                        <option value="">点击选择密保问题</option>
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select>
                    <i data-v-3d6918de="" class="iconfont"></i></td>
            </tr>
            <tr data-v-3d6918de="">
                <td data-v-3d6918de="">答案</td>
                <td data-v-3d6918de="">
                    <input data-v-3d6918de="" type="text" tag="答案" placeholder="请输入答案" class="va84" name="anser1" id="yi"></td>
            </tr>
            <tr data-v-3d6918de=""></tr>
            </tbody>
        </table>
        <table data-v-3d6918de="">
            <tbody data-v-3d6918de="">
            <tr data-v-3d6918de="">
                <td data-v-3d6918de="">问题二</td>
                <td data-v-3d6918de="">
                    <select id="anser2" data-v-3d6918de="" class="va84 unique">
                        <option value="">点击选择密保问题</option>
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select>
                    <i data-v-3d6918de="" class="iconfont"></i></td>
            </tr>
            <tr data-v-3d6918de="">
                <td data-v-3d6918de="">答案</td>
                <td data-v-3d6918de="">
                    <input data-v-3d6918de="" type="text" tag="答案" placeholder="请输入答案" class="va84" name="anser2" id="er">
                </td>
            </tr>
            <tr data-v-3d6918de=""></tr>
            </tbody>
        </table>
        <table data-v-3d6918de="">
            <tbody data-v-3d6918de="">
            <tr data-v-3d6918de="">
                <td data-v-3d6918de="">问题三</td>
                <td data-v-3d6918de="">
                    <select id="anser3" data-v-3d6918de="" class="va84 unique">
                        <option value="">点击选择密保问题</option>
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select>
                    <i data-v-3d6918de="" class="iconfont"></i></td>
            </tr>
            <tr data-v-3d6918de="">
                <td data-v-3d6918de="">答案</td>
                <td data-v-3d6918de="">
                    <input data-v-3d6918de="" type="text" tag="答案" placeholder="请输入答案" class="va84" name="answer3" id="san">
                </td>
            </tr>
            <tr data-v-3d6918de=""></tr>
            </tbody>
        </table>
        <div data-v-3d6918de="" class="loginBtn BTN"><a data-v-3d6918de=""  onclick="sav()">确定</a>
        </div>
        <!--弹框-->
        <div id="question1" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·请选择密保问题一·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="question2" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·请选择密保问题二·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="question3" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·请选择密保问题三·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="anser11" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·答案一不能为空·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="anser22" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·答案二不能为空·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="anser33" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·答案三不能为空·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="wenti" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·选择的问题不能重复·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>

        <div id="shibai" class="layermbox layermbox0 layermshow" index="21" style="display: none;">
            <div class="laymshade"></div>
            <div class="layermmain">
                <div class="section">
                    <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                        <button class="layermend"></button>
                        <div class="layermcont">·密保问题验证失败·</div>
                        <div class="layermbtn"><span type="1">确定</span></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
<script>
    $(".layermbtn").click(function(){
        $(this).parents(".layermbox").hide();
    });
    function sav(){
        var id = $("#uid").val();
        var question1 = $("#anser1").val();
        var question2 = $("#anser2").val();
        var question3 = $("#anser3").val();
        var anser1= $("#yi").val();
        var anser2= $("#er").val();
        var anser3= $("#san").val();

        if(question1 == ''){
           $("#question1").show();
            return false;
        }
        if(anser1 == ''){
            $("#anser11").show();
            return false;
        }
        if(question2 == ''){
            $("#question2").show();
            return false;
        }
        if(anser2 == ''){
            $("#anser22").show();
            return false;
        }
        if(question3 == ''){
            $("#question3").show();
            return false;
        }

        if(anser3 == ''){
            $("#anser33").show();
            return false;
        }
        if(question1 == question2 || question2 == question3 || question1 == question3){
            $("#wenti").show();
            return false;
        }

        $.ajax({
            type: "POST",
            url: "{:U('Index/verifyQuestion')}",
            data: {'id':id,'question1':question1,'question2':question2,'question3':question3,'anser1':anser1,'anser2':anser2,'anser3':anser3},
            success: function(dat){
                if (dat == 111) {
                    window.location.href = "/Index/verifyPwd2/id/"+id;
                } else {
                    $("#shibai").show();
                    return false;
                }
            }
        });
    }
</script>


